using System;
using System.Text;
using System.Data;
using System.Data.Sql;
using System.Collections.Generic;
using System.Reflection;

namespace DocumentManagement
{
  /// <summary>
  /// Tdocuments Data Object Class
  /// </summary>
  public partial class DOTdocuments
  {
    #region Class Constant declarations
    		/// <summary>
		/// The Table Column for the Tdocuments d_id
		/// </summary>
		public const string Rowd_id = "d_id";

		/// <summary>
		/// The Table Column for the Tdocuments d_status
		/// </summary>
		public const string Rowd_status = "d_status";

		/// <summary>
		/// The Table Column for the Tdocuments d_match
		/// </summary>
		public const string Rowd_match = "d_match";

		/// <summary>
		/// The Table Column for the Tdocuments d_exist
		/// </summary>
		public const string Rowd_exist = "d_exist";

		/// <summary>
		/// The Table Column for the Tdocuments d_folder
		/// </summary>
		public const string Rowd_folder = "d_folder";

		/// <summary>
		/// The Table Column for the Tdocuments d_loc
		/// </summary>
		public const string Rowd_loc = "d_loc";

		/// <summary>
		/// The Table Column for the Tdocuments d_accno
		/// </summary>
		public const string Rowd_accno = "d_accno";

		/// <summary>
		/// The Table Column for the Tdocuments d_fileno
		/// </summary>
		public const string Rowd_fileno = "d_fileno";

		/// <summary>
		/// The Table Column for the Tdocuments d_doctype
		/// </summary>
		public const string Rowd_doctype = "d_doctype";

		/// <summary>
		/// The Table Column for the Tdocuments d_stand
		/// </summary>
		public const string Rowd_stand = "d_stand";

		/// <summary>
		/// The Table Column for the Tdocuments d_suburb
		/// </summary>
		public const string Rowd_suburb = "d_suburb";

		/// <summary>
		/// The Table Column for the Tdocuments d_complex
		/// </summary>
		public const string Rowd_complex = "d_complex";

		/// <summary>
		/// The Table Column for the Tdocuments d_custid
		/// </summary>
		public const string Rowd_custid = "d_custid";

		/// <summary>
		/// The Table Column for the Tdocuments d_custname1
		/// </summary>
		public const string Rowd_custname1 = "d_custname1";

		/// <summary>
		/// The Table Column for the Tdocuments d_custname2
		/// </summary>
		public const string Rowd_custname2 = "d_custname2";

		/// <summary>
		/// The Table Column for the Tdocuments d_lasttran
		/// </summary>
		public const string Rowd_lasttran = "d_lasttran";

		/// <summary>
		/// The Table Column for the Tdocuments d_user
		/// </summary>
		public const string Rowd_user = "d_user";

		/// <summary>
		/// The Table Column for the Tdocuments d_goldate
		/// </summary>
		public const string Rowd_goldate = "d_goldate";

		/// <summary>
		/// The Table Column for the Tdocuments d_mbno
		/// </summary>
		public const string Rowd_mbno = "d_mbno";

		/// <summary>
		/// The Table Column for the Tdocuments d_tdno
		/// </summary>
		public const string Rowd_tdno = "d_tdno";

		/// <summary>
		/// The Table Column for the Tdocuments d_hogno
		/// </summary>
		public const string Rowd_hogno = "d_hogno";

		/// <summary>
		/// The Table Column for the Tdocuments d_onwins
		/// </summary>
		public const string Rowd_onwins = "d_onwins";

		/// <summary>
		/// The Table Column for the Tdocuments d_owninsno
		/// </summary>
		public const string Rowd_owninsno = "d_owninsno";

		/// <summary>
		/// The Table Column for the Tdocuments d_lifecomp
		/// </summary>
		public const string Rowd_lifecomp = "d_lifecomp";

		/// <summary>
		/// The Table Column for the Tdocuments d_lifeno
		/// </summary>
		public const string Rowd_lifeno = "d_lifeno";

		/// <summary>
		/// The Table Column for the Tdocuments d_lifecess
		/// </summary>
		public const string Rowd_lifecess = "d_lifecess";

		/// <summary>
		/// The Table Column for the Tdocuments d_lifewaiver
		/// </summary>
		public const string Rowd_lifewaiver = "d_lifewaiver";

		/// <summary>
		/// The Table Column for the Tdocuments d_govtee
		/// </summary>
		public const string Rowd_govtee = "d_govtee";

		/// <summary>
		/// The Table Column for the Tdocuments d_letsure
		/// </summary>
		public const string Rowd_letsure = "d_letsure";

		/// <summary>
		/// The Table Column for the Tdocuments d_nhbrc
		/// </summary>
		public const string Rowd_nhbrc = "d_nhbrc";

		/// <summary>
		/// The Table Column for the Tdocuments d_authpmt
		/// </summary>
		public const string Rowd_authpmt = "d_authpmt";

		/// <summary>
		/// The Table Column for the Tdocuments d_gpadate
		/// </summary>
		public const string Rowd_gpadate = "d_gpadate";

		/// <summary>
		/// The Table Column for the Tdocuments d_addendum
		/// </summary>
		public const string Rowd_addendum = "d_addendum";

		/// <summary>
		/// The Table Column for the Tdocuments d_notes
		/// </summary>
		public const string Rowd_notes = "d_notes";

		/// <summary>
		/// The Table Column for the Tdocuments d_releasetype
		/// </summary>
		public const string Rowd_releasetype = "d_releasetype";

		/// <summary>
		/// The Table Column for the Tdocuments d_releasereason
		/// </summary>
		public const string Rowd_releasereason = "d_releasereason";

		/// <summary>
		/// The Table Column for the Tdocuments d_primaryattorney
		/// </summary>
		public const string Rowd_primaryattorney = "d_primaryattorney";

		/// <summary>
		/// The Table Column for the Tdocuments d_secondaryattorney
		/// </summary>
		public const string Rowd_secondaryattorney = "d_secondaryattorney";

		/// <summary>
		/// The Table Column for the Tdocuments d_notifyreturned
		/// </summary>
		public const string Rowd_notifyreturned = "d_notifyreturned";

		/// <summary>
		/// The Table Column for the Tdocuments d_releasedate
		/// </summary>
		public const string Rowd_releasedate = "d_releasedate";

		/// <summary>
		/// The Table Column for the Tdocuments d_returndate
		/// </summary>
		public const string Rowd_returndate = "d_returndate";

		/// <summary>
		/// The Table Column for the Tdocuments d_primaryattorneyletterreference
		/// </summary>
		public const string Rowd_primaryattorneyletterreference = "d_primaryattorneyletterreference";

		/// <summary>
		/// The Table Column for the Tdocuments d_secondaryattorneyletterreference
		/// </summary>
		public const string Rowd_secondaryattorneyletterreference = "d_secondaryattorneyletterreference";

		/// <summary>
		/// The Table Column for the Tdocuments d_trackingnumber
		/// </summary>
		public const string Rowd_trackingnumber = "d_trackingnumber";


#region Stored Procedures
private const string m_StoredProcedureConstCreate = "spTdocuments_Create";
private const string m_StoredProcedureConstDelete = "spTdocuments_Delete";
private const string m_StoredProcedureConstRetrieve = "spTdocuments_Retrieve";
private const string m_StoredProcedureConstRetrieveall = "spTdocuments_Retrieveall";
private const string m_StoredProcedureConstUpdate = "spTdocuments_Update";
#endregion
    
    
    #endregion

    #region Class Variable declarations
    	#region DO Variables
		private string m_d_id;
		private string m_d_status;
		private bool m_d_match;
		private bool m_d_exist;
		private string m_d_folder;
		private string m_d_loc;
		private string m_d_accno;
		private string m_d_fileno;
		private string m_d_doctype;
		private string m_d_stand;
		private string m_d_suburb;
		private string m_d_complex;
		private string m_d_custid;
		private string m_d_custname1;
		private string m_d_custname2;
		private DateTime m_d_lasttran;
		private string m_d_user;
		private DateTime m_d_goldate;
		private string m_d_mbno;
		private string m_d_tdno;
		private string m_d_hogno;
		private string m_d_onwins;
		private string m_d_owninsno;
		private string m_d_lifecomp;
		private string m_d_lifeno;
		private string m_d_lifecess;
		private DateTime m_d_lifewaiver;
		private string m_d_govtee;
		private DateTime m_d_letsure;
		private bool m_d_nhbrc;
		private bool m_d_authpmt;
		private DateTime m_d_gpadate;
		private string m_d_addendum;
		private string m_d_notes;
		private string m_d_releasetype;
		private string m_d_releasereason;
		private string m_d_primaryattorney;
		private string m_d_secondaryattorney;
		private bool m_d_notifyreturned;
		private DateTime m_d_releasedate;
		private DateTime m_d_returndate;
		private string m_d_primaryattorneyletterreference;
		private string m_d_secondaryattorneyletterreference;
		private string m_d_trackingnumber;
	#endregion
    
	#region Default Variables
	private SQLDataObject sqlData;
	private List<DOTdocuments> m_Tdocumentss = new List<DOTdocuments>();
	#endregion
	
    #endregion

    #region Class Constructors & Destructors
    /// <summary>
    /// Class Constructor
    /// </summary>
    public DOTdocuments() { }
    #endregion

    #region Class Properties
    #region DO Properties
		/// <summary>
		/// d_id
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_id
		/// </remarks>
		public string d_id
		{
			get { return (this.m_d_id); }
			set { this.m_d_id = value; }
		}

		/// <summary>
		/// d_status
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_status
		/// </remarks>
		public string d_status
		{
			get { return (this.m_d_status); }
			set { this.m_d_status = value; }
		}

		/// <summary>
		/// d_match
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_match
		/// </remarks>
		public bool d_match
		{
			get { return (this.m_d_match); }
			set { this.m_d_match = value; }
		}

		/// <summary>
		/// d_exist
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_exist
		/// </remarks>
		public bool d_exist
		{
			get { return (this.m_d_exist); }
			set { this.m_d_exist = value; }
		}

		/// <summary>
		/// d_folder
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_folder
		/// </remarks>
		public string d_folder
		{
			get { return (this.m_d_folder); }
			set { this.m_d_folder = value; }
		}

		/// <summary>
		/// d_loc
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_loc
		/// </remarks>
		public string d_loc
		{
			get { return (this.m_d_loc); }
			set { this.m_d_loc = value; }
		}

		/// <summary>
		/// d_accno
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_accno
		/// </remarks>
		public string d_accno
		{
			get { return (this.m_d_accno); }
			set { this.m_d_accno = value; }
		}

		/// <summary>
		/// d_fileno
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_fileno
		/// </remarks>
		public string d_fileno
		{
			get { return (this.m_d_fileno); }
			set { this.m_d_fileno = value; }
		}

		/// <summary>
		/// d_doctype
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_doctype
		/// </remarks>
		public string d_doctype
		{
			get { return (this.m_d_doctype); }
			set { this.m_d_doctype = value; }
		}

		/// <summary>
		/// d_stand
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_stand
		/// </remarks>
		public string d_stand
		{
			get { return (this.m_d_stand); }
			set { this.m_d_stand = value; }
		}

		/// <summary>
		/// d_suburb
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_suburb
		/// </remarks>
		public string d_suburb
		{
			get { return (this.m_d_suburb); }
			set { this.m_d_suburb = value; }
		}

		/// <summary>
		/// d_complex
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_complex
		/// </remarks>
		public string d_complex
		{
			get { return (this.m_d_complex); }
			set { this.m_d_complex = value; }
		}

		/// <summary>
		/// d_custid
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_custid
		/// </remarks>
		public string d_custid
		{
			get { return (this.m_d_custid); }
			set { this.m_d_custid = value; }
		}

		/// <summary>
		/// d_custname1
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_custname1
		/// </remarks>
		public string d_custname1
		{
			get { return (this.m_d_custname1); }
			set { this.m_d_custname1 = value; }
		}

		/// <summary>
		/// d_custname2
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_custname2
		/// </remarks>
		public string d_custname2
		{
			get { return (this.m_d_custname2); }
			set { this.m_d_custname2 = value; }
		}

		/// <summary>
		/// d_lasttran
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_lasttran
		/// </remarks>
		public DateTime d_lasttran
		{
			get { return (this.m_d_lasttran); }
			set { this.m_d_lasttran = value; }
		}

		/// <summary>
		/// d_user
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_user
		/// </remarks>
		public string d_user
		{
			get { return (this.m_d_user); }
			set { this.m_d_user = value; }
		}

		/// <summary>
		/// d_goldate
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_goldate
		/// </remarks>
		public DateTime d_goldate
		{
			get { return (this.m_d_goldate); }
			set { this.m_d_goldate = value; }
		}

		/// <summary>
		/// d_mbno
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_mbno
		/// </remarks>
		public string d_mbno
		{
			get { return (this.m_d_mbno); }
			set { this.m_d_mbno = value; }
		}

		/// <summary>
		/// d_tdno
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_tdno
		/// </remarks>
		public string d_tdno
		{
			get { return (this.m_d_tdno); }
			set { this.m_d_tdno = value; }
		}

		/// <summary>
		/// d_hogno
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_hogno
		/// </remarks>
		public string d_hogno
		{
			get { return (this.m_d_hogno); }
			set { this.m_d_hogno = value; }
		}

		/// <summary>
		/// d_onwins
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_onwins
		/// </remarks>
		public string d_onwins
		{
			get { return (this.m_d_onwins); }
			set { this.m_d_onwins = value; }
		}

		/// <summary>
		/// d_owninsno
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_owninsno
		/// </remarks>
		public string d_owninsno
		{
			get { return (this.m_d_owninsno); }
			set { this.m_d_owninsno = value; }
		}

		/// <summary>
		/// d_lifecomp
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_lifecomp
		/// </remarks>
		public string d_lifecomp
		{
			get { return (this.m_d_lifecomp); }
			set { this.m_d_lifecomp = value; }
		}

		/// <summary>
		/// d_lifeno
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_lifeno
		/// </remarks>
		public string d_lifeno
		{
			get { return (this.m_d_lifeno); }
			set { this.m_d_lifeno = value; }
		}

		/// <summary>
		/// d_lifecess
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_lifecess
		/// </remarks>
		public string d_lifecess
		{
			get { return (this.m_d_lifecess); }
			set { this.m_d_lifecess = value; }
		}

		/// <summary>
		/// d_lifewaiver
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_lifewaiver
		/// </remarks>
		public DateTime d_lifewaiver
		{
			get { return (this.m_d_lifewaiver); }
			set { this.m_d_lifewaiver = value; }
		}

		/// <summary>
		/// d_govtee
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_govtee
		/// </remarks>
		public string d_govtee
		{
			get { return (this.m_d_govtee); }
			set { this.m_d_govtee = value; }
		}

		/// <summary>
		/// d_letsure
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_letsure
		/// </remarks>
		public DateTime d_letsure
		{
			get { return (this.m_d_letsure); }
			set { this.m_d_letsure = value; }
		}

		/// <summary>
		/// d_nhbrc
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_nhbrc
		/// </remarks>
		public bool d_nhbrc
		{
			get { return (this.m_d_nhbrc); }
			set { this.m_d_nhbrc = value; }
		}

		/// <summary>
		/// d_authpmt
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_authpmt
		/// </remarks>
		public bool d_authpmt
		{
			get { return (this.m_d_authpmt); }
			set { this.m_d_authpmt = value; }
		}

		/// <summary>
		/// d_gpadate
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_gpadate
		/// </remarks>
		public DateTime d_gpadate
		{
			get { return (this.m_d_gpadate); }
			set { this.m_d_gpadate = value; }
		}

		/// <summary>
		/// d_addendum
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_addendum
		/// </remarks>
		public string d_addendum
		{
			get { return (this.m_d_addendum); }
			set { this.m_d_addendum = value; }
		}

		/// <summary>
		/// d_notes
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_notes
		/// </remarks>
		public string d_notes
		{
			get { return (this.m_d_notes); }
			set { this.m_d_notes = value; }
		}

		/// <summary>
		/// d_releasetype
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_releasetype
		/// </remarks>
		public string d_releasetype
		{
			get { return (this.m_d_releasetype); }
			set { this.m_d_releasetype = value; }
		}

		/// <summary>
		/// d_releasereason
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_releasereason
		/// </remarks>
		public string d_releasereason
		{
			get { return (this.m_d_releasereason); }
			set { this.m_d_releasereason = value; }
		}

		/// <summary>
		/// d_primaryattorney
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_primaryattorney
		/// </remarks>
		public string d_primaryattorney
		{
			get { return (this.m_d_primaryattorney); }
			set { this.m_d_primaryattorney = value; }
		}

		/// <summary>
		/// d_secondaryattorney
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_secondaryattorney
		/// </remarks>
		public string d_secondaryattorney
		{
			get { return (this.m_d_secondaryattorney); }
			set { this.m_d_secondaryattorney = value; }
		}

		/// <summary>
		/// d_notifyreturned
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_notifyreturned
		/// </remarks>
		public bool d_notifyreturned
		{
			get { return (this.m_d_notifyreturned); }
			set { this.m_d_notifyreturned = value; }
		}

		/// <summary>
		/// d_releasedate
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_releasedate
		/// </remarks>
		public DateTime d_releasedate
		{
			get { return (this.m_d_releasedate); }
			set { this.m_d_releasedate = value; }
		}

		/// <summary>
		/// d_returndate
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_returndate
		/// </remarks>
		public DateTime d_returndate
		{
			get { return (this.m_d_returndate); }
			set { this.m_d_returndate = value; }
		}

		/// <summary>
		/// d_primaryattorneyletterreference
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_primaryattorneyletterreference
		/// </remarks>
		public string d_primaryattorneyletterreference
		{
			get { return (this.m_d_primaryattorneyletterreference); }
			set { this.m_d_primaryattorneyletterreference = value; }
		}

		/// <summary>
		/// d_secondaryattorneyletterreference
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_secondaryattorneyletterreference
		/// </remarks>
		public string d_secondaryattorneyletterreference
		{
			get { return (this.m_d_secondaryattorneyletterreference); }
			set { this.m_d_secondaryattorneyletterreference = value; }
		}

		/// <summary>
		/// d_trackingnumber
		/// </summary>
		/// <remarks>
		/// This property contains the Tdocuments d_trackingnumber
		/// </remarks>
		public string d_trackingnumber
		{
			get { return (this.m_d_trackingnumber); }
			set { this.m_d_trackingnumber = value; }
		}
		#endregion
    
	#region Default Properties
	public List<DOTdocuments> Tdocumentss
	{
	  get { return m_Tdocumentss; }
	  set { m_Tdocumentss = value; }
	}    
	#endregion
	
    #endregion

    #region Class Methods
    public DataSet Retrieve()
    {
      DataSet returnDS = new DataSet();
      sqlData = new SQLDataObject();
      sqlData.ExecuteDataSetSQL(m_StoredProcedureConstRetrieve + " @" + Rowd_id + "=" + this.d_id);
      return returnDS;
    }

    public bool RetrieveAll()
    {
      sqlData = new SQLDataObject();
      DataSet resultDS = sqlData.ExecuteDataSetSQL(m_StoredProcedureConstRetrieveall);
      return SetClassPropertiesListFromDataSet(resultDS);
    }

    public bool Create()
    {
      bool success = false;
      string sVariables = "";
      sqlData = new SQLDataObject();

      Type type = this.GetType();
      PropertyInfo[] propInfo = type.GetProperties();

      for (int i = 0; i < propInfo.Length; i++)
      {
        if (propInfo[i].PropertyType.Name.IndexOf("List") == -1)
        {
          sVariables += "@" + propInfo[i].Name + " = ";
          if (propInfo[i].PropertyType.Name == "String")
            sVariables += "'" + propInfo[i].GetValue(this, null) + "', ";
          else
            sVariables += propInfo[i].GetValue(this, null) + ", ";
        }
      }

      success = sqlData.ExecuteNonQuerySQL(m_StoredProcedureConstCreate + " " + sVariables.Substring(0, sVariables.Length - 2));

      return success;
    }

    public bool Update()
    {
      bool success = false;
      string sVariables = "";
      sqlData = new SQLDataObject();

      Type type = this.GetType();
      PropertyInfo[] propInfo = type.GetProperties();

      for (int i = 0; i < propInfo.Length; i++)
      {
        if (propInfo[i].PropertyType.Name.IndexOf("List") == -1)
        {
          sVariables += "@" + propInfo[i].Name + " = ";
          if (propInfo[i].PropertyType.Name == "String")
            sVariables += "'" + propInfo[i].GetValue(this, null) + "', ";
          else
            sVariables += propInfo[i].GetValue(this, null) + ", ";
        }
      }

      success = sqlData.ExecuteNonQuerySQL(m_StoredProcedureConstUpdate + " " + sVariables.Substring(0, sVariables.Length - 2));

      return success;
    }

    private bool SetClassPropertiesFromDataSet(DataSet resultDS)
    {
      bool success = false;
      if (resultDS.Tables[0] != null)
      {
        if (resultDS.Tables[0].Rows.Count > 0)
        {
          foreach (DataRow dr in resultDS.Tables[0].Rows)
          {
					if (dr[Rowd_id].ToString() != "")
			this.d_id = dr[Rowd_id].ToString();

		if (dr[Rowd_status].ToString() != "")
			this.d_status = dr[Rowd_status].ToString();

		if (dr[Rowd_match].ToString() != "")
			this.d_match = bool.Parse(dr[Rowd_match].ToString());

		if (dr[Rowd_exist].ToString() != "")
			this.d_exist = bool.Parse(dr[Rowd_exist].ToString());

		if (dr[Rowd_folder].ToString() != "")
			this.d_folder = dr[Rowd_folder].ToString();

		if (dr[Rowd_loc].ToString() != "")
			this.d_loc = dr[Rowd_loc].ToString();

		if (dr[Rowd_accno].ToString() != "")
			this.d_accno = dr[Rowd_accno].ToString();

		if (dr[Rowd_fileno].ToString() != "")
			this.d_fileno = dr[Rowd_fileno].ToString();

		if (dr[Rowd_doctype].ToString() != "")
			this.d_doctype = dr[Rowd_doctype].ToString();

		if (dr[Rowd_stand].ToString() != "")
			this.d_stand = dr[Rowd_stand].ToString();

		if (dr[Rowd_suburb].ToString() != "")
			this.d_suburb = dr[Rowd_suburb].ToString();

		if (dr[Rowd_complex].ToString() != "")
			this.d_complex = dr[Rowd_complex].ToString();

		if (dr[Rowd_custid].ToString() != "")
			this.d_custid = dr[Rowd_custid].ToString();

		if (dr[Rowd_custname1].ToString() != "")
			this.d_custname1 = dr[Rowd_custname1].ToString();

		if (dr[Rowd_custname2].ToString() != "")
			this.d_custname2 = dr[Rowd_custname2].ToString();

		if (dr[Rowd_lasttran].ToString() != "")
			this.d_lasttran = DateTime.Parse(dr[Rowd_lasttran].ToString());

		if (dr[Rowd_user].ToString() != "")
			this.d_user = dr[Rowd_user].ToString();

		if (dr[Rowd_goldate].ToString() != "")
			this.d_goldate = DateTime.Parse(dr[Rowd_goldate].ToString());

		if (dr[Rowd_mbno].ToString() != "")
			this.d_mbno = dr[Rowd_mbno].ToString();

		if (dr[Rowd_tdno].ToString() != "")
			this.d_tdno = dr[Rowd_tdno].ToString();

		if (dr[Rowd_hogno].ToString() != "")
			this.d_hogno = dr[Rowd_hogno].ToString();

		if (dr[Rowd_onwins].ToString() != "")
			this.d_onwins = dr[Rowd_onwins].ToString();

		if (dr[Rowd_owninsno].ToString() != "")
			this.d_owninsno = dr[Rowd_owninsno].ToString();

		if (dr[Rowd_lifecomp].ToString() != "")
			this.d_lifecomp = dr[Rowd_lifecomp].ToString();

		if (dr[Rowd_lifeno].ToString() != "")
			this.d_lifeno = dr[Rowd_lifeno].ToString();

		if (dr[Rowd_lifecess].ToString() != "")
			this.d_lifecess = dr[Rowd_lifecess].ToString();

		if (dr[Rowd_lifewaiver].ToString() != "")
			this.d_lifewaiver = DateTime.Parse(dr[Rowd_lifewaiver].ToString());

		if (dr[Rowd_govtee].ToString() != "")
			this.d_govtee = dr[Rowd_govtee].ToString();

		if (dr[Rowd_letsure].ToString() != "")
			this.d_letsure = DateTime.Parse(dr[Rowd_letsure].ToString());

		if (dr[Rowd_nhbrc].ToString() != "")
			this.d_nhbrc = bool.Parse(dr[Rowd_nhbrc].ToString());

		if (dr[Rowd_authpmt].ToString() != "")
			this.d_authpmt = bool.Parse(dr[Rowd_authpmt].ToString());

		if (dr[Rowd_gpadate].ToString() != "")
			this.d_gpadate = DateTime.Parse(dr[Rowd_gpadate].ToString());

		if (dr[Rowd_addendum].ToString() != "")
			this.d_addendum = dr[Rowd_addendum].ToString();

		if (dr[Rowd_notes].ToString() != "")
			this.d_notes = dr[Rowd_notes].ToString();

		if (dr[Rowd_releasetype].ToString() != "")
			this.d_releasetype = dr[Rowd_releasetype].ToString();

		if (dr[Rowd_releasereason].ToString() != "")
			this.d_releasereason = dr[Rowd_releasereason].ToString();

		if (dr[Rowd_primaryattorney].ToString() != "")
			this.d_primaryattorney = dr[Rowd_primaryattorney].ToString();

		if (dr[Rowd_secondaryattorney].ToString() != "")
			this.d_secondaryattorney = dr[Rowd_secondaryattorney].ToString();

		if (dr[Rowd_notifyreturned].ToString() != "")
			this.d_notifyreturned = bool.Parse(dr[Rowd_notifyreturned].ToString());

		if (dr[Rowd_releasedate].ToString() != "")
			this.d_releasedate = DateTime.Parse(dr[Rowd_releasedate].ToString());

		if (dr[Rowd_returndate].ToString() != "")
			this.d_returndate = DateTime.Parse(dr[Rowd_returndate].ToString());

		if (dr[Rowd_primaryattorneyletterreference].ToString() != "")
			this.d_primaryattorneyletterreference = dr[Rowd_primaryattorneyletterreference].ToString();

		if (dr[Rowd_secondaryattorneyletterreference].ToString() != "")
			this.d_secondaryattorneyletterreference = dr[Rowd_secondaryattorneyletterreference].ToString();

		if (dr[Rowd_trackingnumber].ToString() != "")
			this.d_trackingnumber = dr[Rowd_trackingnumber].ToString();
          }
          success = true;
        }
      }
      return success;
    }

    private bool SetClassPropertiesListFromDataSet(DataSet resultDS)
    {
      bool success = false;
      if (resultDS.Tables[0] != null)
      {
        if (resultDS.Tables[0].Rows.Count > 0)
        {
          foreach (DataRow dr in resultDS.Tables[0].Rows)
          {
            DOTdocuments Tdocuments = new DOTdocuments();
			
					if (dr[Rowd_id].ToString() != "")
			Tdocuments.d_id = dr[Rowd_id].ToString();

		if (dr[Rowd_status].ToString() != "")
			Tdocuments.d_status = dr[Rowd_status].ToString();

		if (dr[Rowd_match].ToString() != "")
			Tdocuments.d_match = bool.Parse(dr[Rowd_match].ToString());

		if (dr[Rowd_exist].ToString() != "")
			Tdocuments.d_exist = bool.Parse(dr[Rowd_exist].ToString());

		if (dr[Rowd_folder].ToString() != "")
			Tdocuments.d_folder = dr[Rowd_folder].ToString();

		if (dr[Rowd_loc].ToString() != "")
			Tdocuments.d_loc = dr[Rowd_loc].ToString();

		if (dr[Rowd_accno].ToString() != "")
			Tdocuments.d_accno = dr[Rowd_accno].ToString();

		if (dr[Rowd_fileno].ToString() != "")
			Tdocuments.d_fileno = dr[Rowd_fileno].ToString();

		if (dr[Rowd_doctype].ToString() != "")
			Tdocuments.d_doctype = dr[Rowd_doctype].ToString();

		if (dr[Rowd_stand].ToString() != "")
			Tdocuments.d_stand = dr[Rowd_stand].ToString();

		if (dr[Rowd_suburb].ToString() != "")
			Tdocuments.d_suburb = dr[Rowd_suburb].ToString();

		if (dr[Rowd_complex].ToString() != "")
			Tdocuments.d_complex = dr[Rowd_complex].ToString();

		if (dr[Rowd_custid].ToString() != "")
			Tdocuments.d_custid = dr[Rowd_custid].ToString();

		if (dr[Rowd_custname1].ToString() != "")
			Tdocuments.d_custname1 = dr[Rowd_custname1].ToString();

		if (dr[Rowd_custname2].ToString() != "")
			Tdocuments.d_custname2 = dr[Rowd_custname2].ToString();

		if (dr[Rowd_lasttran].ToString() != "")
			Tdocuments.d_lasttran = DateTime.Parse(dr[Rowd_lasttran].ToString());

		if (dr[Rowd_user].ToString() != "")
			Tdocuments.d_user = dr[Rowd_user].ToString();

		if (dr[Rowd_goldate].ToString() != "")
			Tdocuments.d_goldate = DateTime.Parse(dr[Rowd_goldate].ToString());

		if (dr[Rowd_mbno].ToString() != "")
			Tdocuments.d_mbno = dr[Rowd_mbno].ToString();

		if (dr[Rowd_tdno].ToString() != "")
			Tdocuments.d_tdno = dr[Rowd_tdno].ToString();

		if (dr[Rowd_hogno].ToString() != "")
			Tdocuments.d_hogno = dr[Rowd_hogno].ToString();

		if (dr[Rowd_onwins].ToString() != "")
			Tdocuments.d_onwins = dr[Rowd_onwins].ToString();

		if (dr[Rowd_owninsno].ToString() != "")
			Tdocuments.d_owninsno = dr[Rowd_owninsno].ToString();

		if (dr[Rowd_lifecomp].ToString() != "")
			Tdocuments.d_lifecomp = dr[Rowd_lifecomp].ToString();

		if (dr[Rowd_lifeno].ToString() != "")
			Tdocuments.d_lifeno = dr[Rowd_lifeno].ToString();

		if (dr[Rowd_lifecess].ToString() != "")
			Tdocuments.d_lifecess = dr[Rowd_lifecess].ToString();

		if (dr[Rowd_lifewaiver].ToString() != "")
			Tdocuments.d_lifewaiver = DateTime.Parse(dr[Rowd_lifewaiver].ToString());

		if (dr[Rowd_govtee].ToString() != "")
			Tdocuments.d_govtee = dr[Rowd_govtee].ToString();

		if (dr[Rowd_letsure].ToString() != "")
			Tdocuments.d_letsure = DateTime.Parse(dr[Rowd_letsure].ToString());

		if (dr[Rowd_nhbrc].ToString() != "")
			Tdocuments.d_nhbrc = bool.Parse(dr[Rowd_nhbrc].ToString());

		if (dr[Rowd_authpmt].ToString() != "")
			Tdocuments.d_authpmt = bool.Parse(dr[Rowd_authpmt].ToString());

		if (dr[Rowd_gpadate].ToString() != "")
			Tdocuments.d_gpadate = DateTime.Parse(dr[Rowd_gpadate].ToString());

		if (dr[Rowd_addendum].ToString() != "")
			Tdocuments.d_addendum = dr[Rowd_addendum].ToString();

		if (dr[Rowd_notes].ToString() != "")
			Tdocuments.d_notes = dr[Rowd_notes].ToString();

		if (dr[Rowd_releasetype].ToString() != "")
			Tdocuments.d_releasetype = dr[Rowd_releasetype].ToString();

		if (dr[Rowd_releasereason].ToString() != "")
			Tdocuments.d_releasereason = dr[Rowd_releasereason].ToString();

		if (dr[Rowd_primaryattorney].ToString() != "")
			Tdocuments.d_primaryattorney = dr[Rowd_primaryattorney].ToString();

		if (dr[Rowd_secondaryattorney].ToString() != "")
			Tdocuments.d_secondaryattorney = dr[Rowd_secondaryattorney].ToString();

		if (dr[Rowd_notifyreturned].ToString() != "")
			Tdocuments.d_notifyreturned = bool.Parse(dr[Rowd_notifyreturned].ToString());

		if (dr[Rowd_releasedate].ToString() != "")
			Tdocuments.d_releasedate = DateTime.Parse(dr[Rowd_releasedate].ToString());

		if (dr[Rowd_returndate].ToString() != "")
			Tdocuments.d_returndate = DateTime.Parse(dr[Rowd_returndate].ToString());

		if (dr[Rowd_primaryattorneyletterreference].ToString() != "")
			Tdocuments.d_primaryattorneyletterreference = dr[Rowd_primaryattorneyletterreference].ToString();

		if (dr[Rowd_secondaryattorneyletterreference].ToString() != "")
			Tdocuments.d_secondaryattorneyletterreference = dr[Rowd_secondaryattorneyletterreference].ToString();

		if (dr[Rowd_trackingnumber].ToString() != "")
			Tdocuments.d_trackingnumber = dr[Rowd_trackingnumber].ToString();

            this.Tdocumentss.Add(Tdocuments);
          }
          success = true;
        }
      }
      return success;
    }
    #endregion

    #region Class Support Methods
    #endregion
  }
}
